# -*- coding: utf-8 -*-
from odoo import models, api, fields, tools
from odoo.exceptions import UserError
import re


class report_temp(models.Model):

    _name = "proman.report_temp"
    _description = "报表模板"
    _table = "proman_report_temp"
    _order = "sequence"

    sequence = fields.Integer(string="排序",translate = 0)
    name = fields.Char(string="报表名称",help = '请输入报表名称',translate = 0)
    report_category_id = fields.Many2one(string="报表类别",comodel_name = 'proman.report_category',translate = 0)
    company_id = fields.Many2one(string="所属公司",comodel_name = 'res.company',default = lambda self:self.env.company,required = 1,translate = 0)
    project_id = fields.Many2one(string="项目名称",comodel_name = 'proman.project_base',translate = 0)
    report_level = fields.Selection(string="报表级别",selection = [('1', '省'), ('2', '市'), ('3', '县'),('4', '村')],default='3',translate = 0)
    report_temp_items = fields.One2many(string="报表清单",comodel_name = 'proman.report_temp_item',inverse_name = 'main_id',translate = 0)
    memo = fields.Html(string="备注说明",translate = 0)
